<template>
  <div class='back-header-wrapper'
    :style="{
      height: height,
      padding: isShowBack? (mode === 'special' ? '4px 0 10px 0' : '0 10px') : '0 24px',
      borderBottom: mode === 'special' ? 'none': '1px solid #E9EAED'}">
      <div class="header-left">
        <span v-show="isShowBack" class='detail-back-icon' @click="goBack()"></span>
        <span class="header-title">{{title ? title: menuName}}</span>
      </div>
      <div class="header-right">
        <slot name="headerRight"></slot>
      </div>
  </div>
</template>

<script>
export default {
  name: 'backHeader',
  props: {
    title: String,
    /**
     * @param mode
     * default 代表默认样式，长用于含有三级及以上左侧菜单的页面;样式特点：竖直方向居中、有下划线
     * special 代表特殊样式，常用于页面没有左侧菜单的内页；样式特点：竖直方向不局中、无下划线
     */
    mode: {
      type: String,
      default: 'default'
    },
    isShowBack: {
      type: Boolean,
      default: true
    },
    height: {
      type: String,
      default: '50px'
    }
  },
  data () {
    return {

    }
  },
  methods: {
    goBack () {
      history.go(-1)
    }
  }
}
</script>

<style lang="stylus" scoped>
.back-header-wrapper
  height 50px
  display flex
  justify-content space-between
  align-items center
  background #fff
  padding-left 10px
  box-sizing border-box
  border-bottom 1px solid #E9EAED
  .header-left,.header-right
    display flex
    align-items center
  .detail-back-icon
    width 36px
    height 36px
    margin-right 18px
    background url('~assets/img/meeting_ic_back@2x.png') no-repeat 0 0 / 36px 36px
    cursor pointer
  .header-title
    font-size: 14px;
    color: #353535;
    font-weight: 700
</style>
